find the magnitude and direction